Other Functions

The following functions are available globally.

  • Returns true if and only if the matrices contain the same elements at the same coordinates. The underlying elements must conform to the Equatable protocol.

    Declaration

    Swift

    public func ==<T: Equatable>(lhs: Matrix<T>, rhs: Matrix<T>) -> Bool
  • Returns true if and only if the graphs contain the same vertices and edges per vertex. The underlying edges must conform to the Equatable protocol.

    Declaration

    Swift

    public func ==<V, E: Equatable>(lhs: Graph<V,E>, rhs: Graph<V,E>) -> Bool
  • Returns true if and only if the circular arrays contain the same elements in the same logical order. The underlying elements must conform to the Equatable protocol.

    Declaration

    Swift

    public func ==<T: Equatable>(lhs: CircularArray<T>, rhs: CircularArray<T>) -> Bool
  • Returns true if and only if the multisets contain the same number of occurrences per element.

    Declaration

    Swift

    public func ==<T>(lhs: Multiset<T>, rhs: Multiset<T>) -> Bool
  • Returns true if and only if the bimaps contain the same key-value pairs.

    Declaration

    Swift

    public func ==<Key, Value>(lhs: Bimap<Key, Value>, rhs: Bimap<Key, Value>) -> Bool
  • Returns true if and only if the stacks contain the same elements in the same order. The underlying elements must conform to the Equatable protocol.

    Declaration

    Swift

    public func ==<U: Equatable>(lhs: Stack<U>, rhs: Stack<U>) -> Bool
  • Returns true if and only if the queues contain the same elements in the same order. The underlying elements must conform to the Equatable protocol.

    Declaration

    Swift

    public func ==<U: Equatable>(lhs: Queue<U>, rhs: Queue<U>) -> Bool
  • Returns true if and only if the priority queues contain the same elements in the same order. The underlying elements must conform to the Equatable protocol.

    Declaration

    Swift

    public func ==<U: Equatable>(lhs: PriorityQueue<U>, rhs: PriorityQueue<U>) -> Bool
  • Returns true if and only if the deques contain the same elements in the same order. The underlying elements must conform to the Equatable protocol.

    Declaration

    Swift

    public func ==<U: Equatable>(lhs: Deque<U>, rhs: Deque<U>) -> Bool
  • Returns true if and only if the tries contain the same elements.

    Declaration

    Swift

    public func ==(lhs: Trie, rhs: Trie) -> Bool
  • Returns true if and only if the bit arrays contain the same bits in the same order.

    Declaration

    Swift

    public func ==(lhs: BitArray, rhs: BitArray) -> Bool
  • Returns the inverse of the given matrix or nil if it doesn’t exist. If the argument is a non-square matrix an error is triggered.

    Declaration

    Swift

    public func inverse(_ matrix: Matrix<Double>) -> Matrix<Double>?
  • Performs matrix and matrix addition.

    Declaration

    Swift

    public func +(lhs: Matrix<Double>, rhs: Matrix<Double>) -> Matrix<Double>
  • Performs matrix and matrix addition.

    Declaration

    Swift

    public func +=(lhs: inout Matrix<Double>, rhs: Matrix<Double>)
  • Performs matrix and scalar addition.

    Declaration

    Swift

    public func +(lhs: Matrix<Double>, rhs: Double) -> Matrix<Double>
  • Performs scalar and matrix addition.

    Declaration

    Swift

    public func +(lhs: Double, rhs: Matrix<Double>) -> Matrix<Double>
  • Performs matrix and scalar addition.

    Declaration

    Swift

    public func +=(lhs: inout Matrix<Double>, rhs: Double)
  • Performs matrix and matrix subtraction.

    Declaration

    Swift

    public func -(lhs: Matrix<Double>, rhs: Matrix<Double>) -> Matrix<Double>
  • Performs matrix and matrix subtraction.

    Declaration

    Swift

    public func -=(lhs: inout Matrix<Double>, rhs: Matrix<Double>)
  • Performs matrix and scalar subtraction.

    Declaration

    Swift

    public func -(lhs: Matrix<Double>, rhs: Double) -> Matrix<Double>
  • Performs matrix and scalar subtraction.

    Declaration

    Swift

    public func -=(lhs: inout Matrix<Double>, rhs: Double)
  • Negates all the values in a matrix.

    Declaration

    Swift

    public prefix func -(m: Matrix<Double>) -> Matrix<Double>
  • Performs matrix and matrix multiplication. The first argument’s number of columns must match the second argument’s number of rows, otherwise an error is triggered.

    Declaration

    Swift

    public func *(lhs: Matrix<Double>, rhs: Matrix<Double>) -> Matrix<Double>
  • Performs matrix and scalar multiplication.

    Declaration

    Swift

    public func *(lhs: Matrix<Double>, rhs: Double) -> Matrix<Double>
  • Performs scalar and matrix multiplication.

    Declaration

    Swift

    public func *(lhs: Double, rhs: Matrix<Double>) -> Matrix<Double>
  • Performs matrix and scalar multiplication.

    Declaration

    Swift

    public func *=(lhs: inout Matrix<Double>, rhs: Double)
  • Performs matrix and scalar division.

    Declaration

    Swift

    public func /(lhs: Matrix<Double>, rhs: Double) -> Matrix<Double>
  • Performs matrix and scalar division.

    Declaration

    Swift

    public func /=(lhs: inout Matrix<Double>, rhs: Double)